package com.gluck.cases.core.block;

import com.github.pagehelper.PageInfo;
import com.gluck.cases.core.modal.dto.CasesGroupDTO;
import com.gluck.cases.core.modal.dto.CasesTestsDTO;

import java.util.List;

/**
 * @ClassName CasesGroupBlock
 * @Desc CasesGroupBlock
 * @Author shiyongzhe
 * @Date 2022/5/28 - 10:09 下午
 **/
public interface CasesGroupBlock {

    /**
     * 功能描述: 查询分组根据创建人username
     *
     * @Params [username]
     * @Return java.util.List<com.gluck.cases.core.modal.entity.CasesGroup>
     * @Author I`m Gluck
     * @Date 2022/6/2
     */
    PageInfo<CasesGroupDTO> queryGroupsByCreateBy(String username, String name, Integer startPage, Integer endPage);

    /**
     * 功能描述: 根据分组id 查询分组测试用例
     *
     * @Params [id]
     * @Return com.github.pagehelper.PageInfo<com.gluck.cases.core.modal.dto.CasesTestsDTO>
     * @Author I`m Gluck
     * @Date 2022/6/3
     */
    PageInfo<CasesTestsDTO> queryTestsByGroupId(Long id, Integer startPage, Integer endPage);

    boolean addGroup(CasesGroupDTO dto);

    boolean deleteGroupById(Long id);

    boolean updateGroup(CasesGroupDTO dto);
    /**
     * 功能描述: 测试组关联测试用例
     * @Params [gid, casesIds]
     * @Return boolean
     * @Author I`m Gluck
     * @Date 2022/6/3
     */
    boolean associateCasesTestsByGroupId(Long gid, String username, List<Long> casesIds);


}
